package com.appkubes.mall.core.pojo;

import com.appkubes.mall.core.po.MallUserStore;
import com.appkubes.mall.core.po.MallUserStoreExample;
import com.appkubes.mall.core.po.MallUserStoreKey;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface MallUserStoreMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserStoreSqlProvider.class, method="countByExample")
    long countByExample(MallUserStoreExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @DeleteProvider(type=MallUserStoreSqlProvider.class, method="deleteByExample")
    int deleteByExample(MallUserStoreExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @Delete({
        "delete from mall_user_store",
        "where user_key = #{userKey,jdbcType=VARCHAR}",
          "and store_key = #{storeKey,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(MallUserStoreKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @Insert({
        "insert into mall_user_store (user_key, store_key, ",
        "app_key, create_time, ",
        "update_time, version)",
        "values (#{userKey,jdbcType=VARCHAR}, #{storeKey,jdbcType=VARCHAR}, ",
        "#{appKey,jdbcType=VARCHAR}, #{createTime,jdbcType=INTEGER}, ",
        "#{updateTime,jdbcType=INTEGER}, #{version,jdbcType=INTEGER})"
    })
    int insert(MallUserStore record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @InsertProvider(type=MallUserStoreSqlProvider.class, method="insertSelective")
    int insertSelective(MallUserStore record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserStoreSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserStore> selectByExampleWithRowbounds(MallUserStoreExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @SelectProvider(type=MallUserStoreSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    List<MallUserStore> selectByExample(MallUserStoreExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @Select({
        "select",
        "user_key, store_key, app_key, create_time, update_time, version",
        "from mall_user_store",
        "where user_key = #{userKey,jdbcType=VARCHAR}",
          "and store_key = #{storeKey,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="user_key", property="userKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="store_key", property="storeKey", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="app_key", property="appKey", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.INTEGER),
        @Result(column="update_time", property="updateTime", jdbcType=JdbcType.INTEGER),
        @Result(column="version", property="version", jdbcType=JdbcType.INTEGER)
    })
    MallUserStore selectByPrimaryKey(MallUserStoreKey key);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserStoreSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") MallUserStore record, @Param("example") MallUserStoreExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserStoreSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") MallUserStore record, @Param("example") MallUserStoreExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @UpdateProvider(type=MallUserStoreSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(MallUserStore record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table mall_user_store
     *
     * @mbg.generated
     */
    @Update({
        "update mall_user_store",
        "set app_key = #{appKey,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=INTEGER},",
          "update_time = #{updateTime,jdbcType=INTEGER},",
          "version = #{version,jdbcType=INTEGER}",
        "where user_key = #{userKey,jdbcType=VARCHAR}",
          "and store_key = #{storeKey,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(MallUserStore record);
}